package demo19;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 * @date 2023/3/9 18:27
 */
public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始了...");
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream("fos.txt");
        }catch (Exception e) {
            System.out.println("IOException");
        }finally {
            try {
                fos.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        System.out.println("程序结束了...");
    }
}
